package com.gwtt.simulator.netconf.model.rpc.reply;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
@XStreamAlias("rpc-error")
public class RpcError {

    /**
     * 参考{@link ErrorType}
     */
    @XStreamAlias("error-type")
    private ErrorType errorType;

    @XStreamAlias("error-severity")
    private ErrorSeverity errorSeverity;
    /**
     * 标识错误条件
     */
    @XStreamAlias("error-app-tag")
    private String errorAppTag;

    /**
     * 标识错误条件
     */
    @XStreamAlias("error-tag")
    private String errorTag;

    @XStreamAlias("error-path")
    private String errorPath;

    @XStreamAlias("error-message")
    private String errorMessage;

    @XStreamAlias("error-info")
    private String errorInfo;

    public enum ErrorSeverity {
        error, warning
    }

    public enum ErrorType {
        transport, rpc, protocol, application
    }
}
